package com.daedalus.intro;
/*
Define a method hypotenuse that calculates the length of the hypotenuse of a right triangle
when the lengths of the other two sides are given. (Use the sample data in Fig. 6.26.) The method
should take two arguments of type double and return the hypotenuse as a double. Incorporate this
method into an application that reads values for side1 and side2 and performs the calculation with
the hypotenuse method.
 */

import java.util.Scanner;

public class ushtrimi6_15 {

    public static void main(String[] args){

        double katet1;
        double katet2;
        double hipotenuza;

        Scanner hyrje = new Scanner(System.in);
        System.out.print("Jep katetin e pare: ");
        katet1 = hyrje.nextDouble();
        System.out.print("Jep katetin e dyte: ");
        katet2 = hyrje.nextDouble();

        hipotenuza= Math.sqrt(Math.pow(katet1,2)+Math.pow(katet2,2));
        System.out.printf("\n Hipotenuza = %.2f",hipotenuza);
    }
}
